<template>
<!-- 经销商资金异动明细 -->
  <div>
    <FilterTable
      ref="table"
      :columns="columns"
      :fetchapi="fetchApi"
      :params="fetchParams"
      :datakey="'records'"
      :onColumnsChange="columns => this.columns = columns"
      :isSelectColumn="false"
    >

    </FilterTable>
    <div style="height:47px;"></div>
    <div
      :style="{
        position: 'absolute',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'right'
      }"
    >
      <el-button @click="closeDrawer(1)">关 闭</el-button>
    </div>
  </div>
</template>
<script>

import {findCashFrozenFlow} from '@/api/partsmanage/financialManagement/capitalAccount/index';
import { dictionary } from '@/utils/dictMixin';
export default {
  props: {
    params: {
      type: Object,
      required: true,
      default: () => {}
    },
  },
  data(){
    return{
      columns:this.createdTable(),
      fetchParams:{},
      fetchApi:findCashFrozenFlow
    }
  },
  mixins:[dictionary],
  created(){
    this.fetchParams = Object.assign({},this.fetchParams,this.params)
  },
  methods:{
    closeDrawer(val){
      this.$emit('close')
    },
    createdTable(){
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '订单号',
          dataIndex: 'operateNumber',
          sorter: true,
          filter: true,
          filterType: 'input',
        },
        {
          title: '账户类型',
          dataIndex: 'accountType',
          sorter: true,
          filter: true,
          dictItems: this.createDictList('3004')
        },
        {
          title: '冻结金额',
          dataIndex: 'frozenCapital',
          sorter: true,
          precision: 2,
        },
        {
          title: '冻结日期',
          dataIndex: 'createdAt',
          sorter: true,
          filter: true,
          filterType: 'date-range',
          dateFormat:'yyyy-MM-dd'
          // dateFormat:'yyyy-MM-dd HH:mm:ss'
        },
      ]
    },
  },

}
</script>
